package cn.javass.dp.strategy.mydemo3;

/**
 * <p><em>Created on 2021/1/28 9:46</em></p>
 *
 * @author x
 * @since 1.0.1
 */
public class OfflineMessageContext {

    private String type;

    private OfflineMessageStrategy strategy;

    public OfflineMessageContext(String type) {
        this.type = type;
    }

    public void saveOfflineMessage()  {
        System.out.println(this.type);
        if (type == "text") {
            strategy = new SaveOffline1();
        } else {
            System.out.println("ni shi sx");
        }
        strategy.saveOfflineMessage(this);
    }
}
